package com.study.design.pattern.pattern.behavioral.observer.spring;

import org.springframework.context.ApplicationEvent;

/**
 * @Author: gongsl
 * @Date: 2025-03-23 23:43
 * @description: 天气变化事件
 */
public class WeatherChangeEvent extends ApplicationEvent {
    private final double oldTemperature;
    private final double newTemperature;

    public WeatherChangeEvent(Object source, double oldTemperature, double newTemperature) {
        super(source);
        this.oldTemperature = oldTemperature;
        this.newTemperature = newTemperature;
    }

    public double getOldTemperature() {
        return oldTemperature;
    }

    public double getNewTemperature() {
        return newTemperature;
    }
}
